package com.xinqi.modules.course.demonstrate.service.impl;

import com.xinqi.modules.course.demonstrate.bean.ClassDemoDTO;
import com.xinqi.modules.course.demonstrate.service.DemoGroupService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 异步生成课程内容
 *
 * @author dzy
 */
@Service("demoSyncService")
@RequiredArgsConstructor
public class DemoSyncService {

    /**
     * 分组
     */
    private final DemoGroupService demoGroupService;

    public void initGroup(Long courseId, Long classId, Long oldClassId) {
        // 重新生成分组信息
        ClassDemoDTO classDemo = new ClassDemoDTO();
        classDemo.setId(classId);
        classDemo.setOldId(oldClassId);
        classDemo.setCourseId(courseId);
        demoGroupService.initGroupSql(classDemo);
    }
}
